class Document < ActiveRecord::Base
  
  has_attached_file :content,
                    :url => "/archivos/:class/:id/:style/:basename.:extension",
                    :path => Coordina::Application.config.paperclip_config['server_path'] + "/:class/:id/:style/:basename.:extension"
                  
  validates_attachment_presence :content
  validates :name, :presence   => true
  validates :description, :presence => true
  
  belongs_to :category
  has_and_belongs_to_many :accounts
  
  def content_url
    content.url();
  end
end
